<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>垂直居中</title>
  <style>
    p {
      font-size: 100px;
      /* display: flex; */
    }
    .a {
      font-family: Helvetica;
      background: coral;
      /* display: inline-block; */
    }
    .b {
      font-family: Gruppo;
      background: darkcyan;
      display: inline-block;
    }
    .c {
      font-family: fantasy;
      background: darkkhaki;
      display: inline-block;
    }
  </style>
</head>
<body>
  <p>
    <span class="a">Buttong</span>
    <span class="b">Buttong</span>
    <span class="c">Buttong</span>
  </p>

  <div id="main" style="font-size:20px; height:10em;">
    <div id="sub-1" style="font-size:15px; height:1em; margin:1em;background-color: darkkhaki;"></div>
    <div id="sub-2" style="font-size:15px; height:2em; margin:1em;background-color:darkorange;"></div>
  </div>
</body>
</html>